import { createSlice } from "@reduxjs/toolkit";

const initialState = {

}

export const counterSlice = createSlice({
    name: 'userInfo',
    initialState,
    reducers: {
        userinfo: (state, actions) => {
            state = actions.payload
        },
        clearUser: (state,actions) => {
            state = actions.payload
        }
    },
})

// 这里的actions对应的是上面的reducers function
export const { userinfo, clearUser } = counterSlice.actions

export default counterSlice.reducer